﻿<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="survey_question.aspx.cs" Inherits="Admin_survey_question" Title="Add Questions to Survey" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="RadDatePicker" ResourceUICultures="RadDatePicker" />
        </Scripts>
    </asp:ScriptManager>
    <center>            
        <asp:Button ID="cmdChooseSur" runat="server"  
            Text="Choose Survey" Height="30px" onclick="cmdChooseSur_Click" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="lblSurTitle" runat="server" style="font-weight:bold"></asp:Label><asp:TextBox ID="txtSurId" runat="server" Width="50px" Enabled="false" Visible="false"></asp:TextBox>
    </center>
    <asp:Panel ID="Panel1" CssClass="panel" runat="server">
        <div class="row">
            <div class="left">ID:</div>
            <div class="right"><asp:TextBox ID="txtId" runat="server" Width="50px" Enabled ="false" ></asp:TextBox></div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left">Title:</div>
            <div class="right"><asp:TextBox ID="txtTitle" runat="server" Width="350px" Enabled="false"></asp:TextBox>
            </div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left">Description:</div>
            <div class="right"><asp:TextBox ID="txtDes" runat="server" Width="350px" 
                    Height="80px" TextMode="MultiLine"></asp:TextBox>
            </div>
        </div>
        <div class="clear"></div>
          <div class="row">
            <div class="left">Category:</div>
            <div class="right">
                <asp:DropDownList ID="DropDownList1" runat="server" Width="350px">
                    <asp:ListItem Value="-1">Please select...</asp:ListItem>
                </asp:DropDownList>
            </div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left">Status:</div>
            <div class="right">
                <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
                    RepeatDirection="Horizontal">
                
                    <asp:ListItem Value="True">Active</asp:ListItem>
                    <asp:ListItem Value="False">Inactive</asp:ListItem>
                
                </asp:RadioButtonList>
            </div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left">Create at:</div>
            <div class="right">
            <telerik:RadDatePicker ID="RadDatePicker1" runat="server" DateInput-DateFormat="dd/MM/yyyy">
            </telerik:RadDatePicker>
                    
            </div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left"></div>
            <div class="right" style="margin:10px 0px">
                <asp:Button ID="cmdChoose1" runat="server" Text="Choose this Survey" 
                    onclick="cmdChoose1_Click" Height="30px" />
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="cmdHide1" runat="server" Text="Hide" onclick="cmdHide1_Click" 
                    Height="30px" />
            </div>
        </div>
        <div class="clear"></div>
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server">
    
    <div style="text-align:center;margin:10px;font-weight:bold;font-size:18px;">
        <asp:Label ID="lblInfo" runat="server" Text="Please choose Survey first"></asp:Label>
    </div> 
        <asp:GridView ID="GridView1" runat="server" BackColor="White" 
        BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="6" 
        ForeColor="Black" GridLines="Horizontal" AllowPaging="True" 
        AutoGenerateColumns="False" Width="990px" DataKeyNames="id" onrowediting="GridView1_RowEditing" 
        onpageindexchanging="GridView1_PageIndexChanging">
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" />
            <asp:BoundField DataField="title" HeaderText="Title" />
            <asp:BoundField DataField="name" HeaderText="Category" />
            <asp:BoundField DataField="status" HeaderText="Status" />
            <asp:BoundField DataField="date" HeaderText="Date" />
            <asp:CommandField EditImageUrl="~/images/Admin/information.png" HeaderText="Edit" 
                ShowEditButton="True" ButtonType="Image" >
                <ItemStyle Font-Underline="True" HorizontalAlign="Center" Width="40px" />
            </asp:CommandField>
        </Columns>
        <PagerStyle BackColor="#99CCFF" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
    </asp:GridView>

     </asp:Panel>
     
     <asp:Panel ID="Panel3" CssClass="panel" runat="server">
        <div class="row">
            <div class="left" style="text-align:center">Question:</div>
            <div class="right" style="margin-top:10px"><asp:Label ID="lblQuestionAnswer" style="font-weight:bold;" runat="server"></asp:Label>
            <asp:TextBox ID="txtQuesId" runat="server" Width="50px" Visible = "false" ></asp:TextBox>
            </div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left" style="text-align:center">Answers:</div>
            <div class="right">
                <asp:DataList ID="DataList1" runat="server">
                    <ItemTemplate>
                        <div style="margin:5px 0px">&nbsp;&nbsp;&nbsp;&#8226;&nbsp;&nbsp; <asp:Label ID="Label3" 
                                runat="server" Text='<%# Eval("answer") %>' ></asp:Label>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
            </div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left"></div>
            <div class="right" style ="margin:10px 0px">
                <asp:Button ID="cmdChoose2" runat="server" Text="Add this Question" 
                    onclick="cmdChoose2_Click" Height="30px" />
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="cmdHide2" runat="server" Text="Hide" 
                    onclick="cmdHide2_Click" Height="30px" />
            </div>
        </div>
        <div class="clear"></div>
    </asp:Panel>
    <asp:Panel ID="Panel4" runat="server">
    <div style="text-align:center;margin:10px;font-weight:bold;font-size:18px;">
        <asp:Label ID="Label1" runat="server" Text="All questions list"></asp:Label>
    </div> 
        <asp:GridView ID="GridView2" runat="server" BackColor="White" 
        BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="6" 
        ForeColor="Black" GridLines="Horizontal" AllowPaging="True" 
        AutoGenerateColumns="False" Width="700px" DataKeyNames="id" onrowediting="GridView2_RowEditing" 
        onpageindexchanging="GridView2_PageIndexChanging" HorizontalAlign="Center">
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" />
            <asp:BoundField DataField="question" HeaderText="Questions" />
            <asp:BoundField DataField="type" HeaderText="Type" />
            <asp:CommandField EditImageUrl="~/images/Admin/information.png" HeaderText="View" 
                ShowEditButton="True" ButtonType="Image" >
                <ItemStyle Font-Underline="True" HorizontalAlign="Center" Width="40px" />
            </asp:CommandField>
        </Columns>
        <PagerStyle BackColor="#99CCFF" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
    </asp:GridView>
    </asp:Panel>
    
    <asp:Panel ID="Panel5" runat="server">
    <div style="text-align:center;margin:10px;font-weight:bold;font-size:18px;">
        <asp:Label ID="Label2" runat="server" Text="Questions list of this Survey"></asp:Label>
    </div> 
        <asp:GridView ID="GridView3" runat="server" BackColor="White" 
        BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="6" 
        ForeColor="Black" GridLines="Horizontal" AllowPaging="True" 
        AutoGenerateColumns="False" Width="700px" DataKeyNames="id" 
        onpageindexchanging="GridView3_PageIndexChanging" HorizontalAlign="Center" 
            onrowdeleting="GridView3_RowDeleting">
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" />
            <asp:BoundField DataField="question" HeaderText="Questions" />
            <asp:BoundField DataField="type" HeaderText="Type" />
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:Button ID="deleteButton" runat="server" CommandName="Delete" style="width:16px;height:16px;background:url(../images/Admin/cross.png);border:none;cursor:pointer;" OnClientClick="return confirm('Are you sure?');" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="40px" />
            </asp:TemplateField>
        </Columns>
        <PagerStyle BackColor="#99CCFF" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
    </asp:GridView>
    
     </asp:Panel>
</asp:Content>

